{include file="public/header"/}
<div class="wrapper">
	<div class="mod-toolbar-top cf">
		<div class="fl"><strong class="tit">发货地址</strong>
		</div>
		<div class="fr">
			<a href="#" class="ui-btn ui-btn-sp mrb ui-btn-add" id="btn-add"
				onclick="lopen('add.html','新增', '650px', '450px')">新增</a>
			<!--<a class="ui-btn mrb" id="btn-disable">禁用</a><a class="ui-btn mrb" id="btn-enable">启用</a>-->
			<!--<a class="ui-btn mrb" id="btn-print">打印</a>-->
			<!--<a class="ui-btn mrb" id="btn-import">导入</a>-->
			<!--<a class="ui-btn mrb" id="btn-export">导出</a>-->
			<a class="ui-btn" id="btn-refresh" onclick="reload()">刷新</a>
		</div>
	</div>
	<div class="grid-wrap">
		<table id="grid">
		</table>
		<div id="page"></div>
	</div>


	<script type="text/javascript">

		//$(function(){
		$(document).ready(function () {
			//alert("1111");
			$("#grid").jqGrid({
				url: '/admin/shippingaddress/index.html?ajax=100',
				datatype: "json",//数据来源，本地数据（local，json,jsonp,xml等）
				height: '90%',//高度，表格高度。可为数值、百分比或'auto'
				//width: Public.setGrid().w,
				//height: Public.setGrid().h,
				colNames: ["操作", "地址简称", "联系人", "联系电话", "手机号码", "省", "市", "区", "详细地址", "邮政编码", "默认地址"],
				colModel: [
					{ name: 'id', index: 'id', width: 70, formatter: cLink },
					{ name: 'shortName', width: 100 },
					{ name: 'linkman', width: 100, align:'center' },
					{ name: 'phone', width: 100, align:'center' },
					{ name: 'mobile', width: 100 , align:'center'},
					{ name: 'province', width: 60, align:'center' },
					{ name: 'city', width: 60, align:'center' },
					{ name: 'area', width: 60, align:'center' },
					{ name: 'address', width: 150 },
					{ name: 'postalcode', width: 80 , align:'center'},
					{ name: 'isDefault', width: 80, align:'center', formatter: cDefault },
					// { name: 'status', index: 'name asc', formatter: cLink },
				],
				rowNum: 10,
				rowList: [10, 20, 30],
				sortname: 'id',
				sortorder: "desc",
				pagerpos: "left",//分页位置
				multiselect:true, //自带复选框
				pgbuttons: true,//翻页按钮
				pagination: true,
				altRows: !0,
				gridview: !0,
				shrinkToFit: !1,
				cellLayout: 8,
				autowidth: !0,
				pager: "#page",
				viewrecords: !0,
				cmTemplate: {
					sortable: !1,
					title: !1
				},
				loadError: function (t, e, i) {
					parent.Public.tips({
						type: 1,
						content: "操作失败了哦，请检查您的网络链接！"
					})
				}
			});
		});

		function cLink(cellvalue, options, rowObject) {
			return '<div class="operating"><span class="ui-icon ui-icon-pencil" onclick="lopen(\'edit.html?id=' + rowObject.id + '\',\'编辑\',\'650px\',\'450px\')">修改</span> <span class="ui-icon ui-icon-trash" onclick="del(' + rowObject.id + ')">删除</span></div>';
		}

		function cDefault(cellvalue, options, rowObject) {
			return rowObject.isDefault ? '是' : '否';
		}
	</script>


	{include file="public/footer"/}